package org.hxzon.demo.groovy

import groovy.swing.SwingBuilder

class SwingDemo {

    static main(args) {
        def swing = new SwingBuilder()
        def widget = swing.frame(title:'My Frame', defaultCloseOperation:javax.swing.WindowConstants.EXIT_ON_CLOSE) {
            panel() {
//                for (entry in someBean) {
//                    label(text:entry.key)
//                    textField(text:entry.value)
//                }
                label 'Date'
                spinner(model:spinnerDateModel())
                button(text:'OK', actionPerformed:{ println("I've been clicked with event ${it}") })
            }
        }
        widget.pack()
        widget.show()
    }
}
